//
//  safeViewController.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/14.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "safeViewController.h"
#import "safeTableViewCell.h"
#import "changePwdViewController.h"
#import "realNameViewController.h"

@interface safeViewController ()<UITableViewDelegate , UITableViewDataSource>{
    
    NSArray *titleArray;
}

@property(nonatomic,strong) NSMutableArray *dataArray;
@property(nonatomic,strong) NSMutableDictionary *dataDic;
@property(nonatomic,strong) UITableView *helpTableView;
@property(nonatomic,strong) UILabel *moneyNumLabel;

@end

@implementation safeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initView];
}

#pragma mark ------------------ init -------------------

- (void)initView{
    
    self.title = @"账号与安全";
    titleArray = @[@"修改登录密码",@"实名认证"];
    
    _helpTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, scrWidth(), scrHeight() - 64)];
    _helpTableView.backgroundColor = getColor(@"ffffff");
    _helpTableView.delegate = self;
    _helpTableView.dataSource = self;
    _helpTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:_helpTableView];
    
    UIView *threadView = [[UIView alloc]initWithFrame:CGRectMake(0, screenScale(1), scrWidth(), screenScale(0.7))];
    threadView.backgroundColor = getColor(@"cccccc");
    [self.view addSubview:threadView];
}

#pragma mark -------------------- tableView ----------------------

#pragma mark --- UITableViewDelegate ---

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return screenScale(49);
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        
        changePwdViewController *vc = [[changePwdViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
    }else if (indexPath.row == 1){
        
        realNameViewController *vc = [[realNameViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
    }
}

#pragma mark --- UITableViewDataSource ---

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView registerClass:[safeTableViewCell class] forCellReuseIdentifier:@"identifier"];
    safeTableViewCell *cell = (safeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"identifier" forIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    cell.nameLable.text = titleArray[indexPath.row];
    
    
    return cell;
}

@end
